use dataset_candidates_house, clear

eststo clear
eststo: quietly reg pnumcand_d  anyfrack i.year, a(groupid) cl(groupid)
eststo: quietly reg pnumcand_r  anyfrack i.year, a(groupid) cl(groupid)
eststo: quietly reg p_cfscore_d  anyfrack i.year, a(groupid) cl(groupid)
eststo: quietly reg p_cfscore_r  anyfrack i.year, a(groupid) cl(groupid)
eststo: quietly reg g_cfscore_d  anyfrack i.year, a(groupid) cl(groupid)
eststo: quietly reg g_cfscore_r  anyfrack i.year, a(groupid) cl(groupid)

label variable anyfrack "Any wells"

#delimit;

esttab
	using "_output/tableA12.tex"
	,
		booktabs
		replace
		drop(*year*)
		se
		compress
		mtitles(D R D R D R)
		label
		mgroups(
			"Number of Primary Candidates" 
			"Primary Election CF Scores"
			"General Election CF Scores", 		 
			pattern(1 0 1 0 1 0)
			prefix(\multicolumn{@span}{c}{) suffix(})
			span erepeat(\cmidrule(lr){@span})
		)	
		nonote
		stats(N, label ("Observations") fmt(%20.0fc))
		;

#delimit cr
